package factory

//简单工厂使用接口直接就可以实现

type machine interface {
	working()
}

type vehicle struct {
	weight int64
}

func (v vehicle) working() {

}

type fridge struct {
	age int64
}

func (f fridge) working() {

}

func NewMachine(s string) machine {
	switch s {
	case "car":
		return &vehicle{}
	case "media":
		return &fridge{}
	}

	return nil
}
